package code.Frame.userFrame;

import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.table.TableCellRenderer;
import java.awt.*;

/*
    自定义表项的组件
 */
public class myJSpinner extends JSpinner
{
    public myJSpinner()
    {
        super();
        addChangeListener(new ChangeListener() {
            @Override
            public void stateChanged(ChangeEvent e)
            {
                int val = (int) getValue();
                if (val < 0)
                    setValue(0);
                if (val >= 100)
                    setValue(99);
            }
        });
    }
}
